<?php namespace App\Http\Middleware;

use Closure;
use Session;
use App;
class IsAttestation {

	/**
	 * Handle an incoming request.
	 *
	 * @param  \Illuminate\Http\Request  $request
	 * @param  \Closure  $next
	 * @return mixed
	 */
	public function handle($request, Closure $next)
	{
		if(Session::has("user"))
		{
			$is_verified = Session::get("user")['is_verified'];
			if($is_verified == 0)
			{
				return $next($request);
			}
		}
		return App::abort(404);
	}

}
